package unit2;

public class Ex2_9_ForDemo {
    public static void main(String[] args) {
        int i, s; // 变量声明
        for (i = 1, s = 0; i <= 100; i++) {
            s = s + i; // 累加求和
        }
        System.out.println("1+2+3+……+100之和为：" + s);
    }
}
